#include "../H/DiskShooter.h"

//------------------------------------------------------------------------------
// METHOD:  DiskShooter::DiskShooter()
// Type:	Constructor
//------------------------------------------------------------------------------
//
//------------------------------------------------------------------------------
DiskShooter::DiskShooter()
{
	printf("BEGIN:  DiskShooter()\n");
	pShooterMotor = new Victor (DIGITAL_SIDECAR_MODULE,SHOOTER_MOTOR_CH);
	pTriggerMotor = new Victor (DIGITAL_SIDECAR_MODULE,TRIGGER_MOTOR_CH);

	printf("END:    DiskShooter()\n");
}
//------------------------------------------------------------------------------
// METHOD:  DiskShooter::~DiskShooter()
// Type:	Destructor
//------------------------------------------------------------------------------
//
//------------------------------------------------------------------------------
DiskShooter::~DiskShooter()
{
	// Does nothing
}
//------------------------------------------------------------------------------
// METHOD:  DiskShooter::ShootOneDisk()
// Type:	Method
//------------------------------------------------------------------------------
//
//------------------------------------------------------------------------------
bool DiskShooter::ShootOneDisk()
{
	printf("BEGIN:  DiskShooter::ShootOneDisk()\n-----\n");

	shooting = true;
	if(spoolUpCount <= 20)
	{
		pShooterMotor->Set(SHOOTER_SPEED);
		spoolUpCount++;
	}
	else if (shootingCount < 10)
	{
		pShooterMotor->Set(SHOOTER_SPEED);
		pTriggerMotor->Set(TRIGGER_SPEED);
		shootingCount++;
	}
	else
	{
		pShooterMotor->Set(ALL_STOP);
		pTriggerMotor->Set(ALL_STOP);
		shootingCount = 0;
		spoolUpCount  = 0;
		shooting 	  = false;
	}

	printf("END:    DiskShooter::DetermineDiskLocation()\n");
	return shooting;
}
